//
//  HomeEqumentCell.m
//  AILock
//
//  Created by 谭亚明 on 2020/6/25.
//  Copyright © 2020 tym. All rights reserved.
//

#import "HomeEqumentCell.h"
#import "Sizes.h"
#import "UIImageView+YPImage.h"
@interface HomeEqumentCell()

@property(nonatomic,weak) IBOutlet UIView *contView;
@property(nonatomic,weak) IBOutlet UIImageView *imageView;
@property(nonatomic,weak) IBOutlet UILabel *nameLab;
@property(nonatomic,weak)IBOutlet UILabel *roomLab;
@property(nonatomic,weak)IBOutlet UILabel *lineLab;


@end

@implementation HomeEqumentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contView.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor;
    self.contView.layer.cornerRadius = 10;
    [self.contView sizeToFit];
}

-(void)setEquimModel:(EquipmentModel *)equimModel{
    _equimModel = equimModel;
    if(_equimModel.online){
        _lineLab.text = @"•在线";
        _lineLab.textColor = rgba(72, 132, 255);
    }else{
        _lineLab.text = @"•离线";
        _lineLab.textColor = rgba(207, 213, 229);
    }
    [_imageView yp_setImageUlr:[_equimModel getEquipmentImage]];
    _nameLab.text = _equimModel.equipmentName;
    _roomLab.text = _equimModel.roomName;
}

+(CGSize)cellHeight{
    return CGSizeMake((ScreenWidth-15)/2, 146.5+15);
}

+(NSString*)identifiter{
    return @"HomeEqumentCell";
}
@end
